package com.fortune.service;

import com.fortune.dto.in.returnDeposit.AddDto;
import com.fortune.dto.in.returnDeposit.EditDto;
import com.fortune.dto.in.returnDeposit.ReturnDepositEditDto;
import com.fortune.vo.cReturnDeposit.DealerList;
import com.fortune.vo.returnDeposit.*;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface ReturnDepositService {
    /**
     * 新增押金工单
     * @param did
     * @param clientId
     * @param orderNo
     * @param crdid
     * @param userId
     * @return
     */
    int addReturnDeposit(@Param("did") String did,
                         @Param("clientId") String clientId,
                         @Param("crdid") String crdid,
                         @Param("orderNo") String orderNo,
                         @Param("userId") String userId);

    /**
     * 新增退押金工单详情
     * @param mid
     * @param did
     * @param clientId
     * @param crdid
     * @param orderNum
     * @param productId
     * @param productCount
     * @param depositPrice
     * @return
     */
    int addReturnDepositDetails(@Param("did") String did,
                                @Param("clientId") String clientId,
                                @Param("crdid") String crdid,
                                @Param("orderNum") int orderNum,
                                @Param("mid") String mid,
                                @Param("productId") String productId,
                                @Param("productCount") float productCount,
                                @Param("depositPrice") BigDecimal depositPrice);

    /**
     * 编辑押金工单
     * @param editDto
     * @param did
     * @return
     */
    int editReturnDeposit(@Param("editDto") EditDto editDto,
                          @Param("did") String did);

    /**
     * 删除押金工单
     * @param id
     * @return
     */
    int deleteReturnDeposit(@Param("did") String did,
                             @Param("id") String id);

    /**
     * 未处理工单
     * @param did
     * @param userId
     * @return
     */
    List<ReturnDepositInfo> findReturnDepositInfoByUn(@Param("did") String did,
                                                      @Param("userId") String userId);

    /**
     * 已批准工单
     * @param did
     * @param userId
     * @return
     */
    List<ReturnDepositInfo> findReturnDepositInfoByApproved(@Param("did") String did,
                                                            @Param("userId") String userId);

    /**
     * 已接货工单
     * @param did
     * @param userId
     * @return
     */
    List<ReturnDepositInfo> findReturnDepositInfoByReceived(@Param("did") String did,
                                                            @Param("userId") String userId);

    /**
     * 已完成工单
     * @param did
     * @param userId
     * @return
     */
    List<ReturnDepositInfo> findReturnDepositInfoByCompleted(@Param("did") String did,
                                                             @Param("userId") String userId);

    /**
     * 查询已提交的工单详情
     * @param did
     * @param wOrderId
     * @param clientId
     * @return
     */
    DepositDetailsSubmit findDepositDetailsSubmit(@Param("did") String did,
                                                  @Param("wOrderId") String wOrderId,
                                                  @Param("clientId") String clientId);

    /**
     *  查询已批准的工单详情
     * @param did
     * @param wOrderId
     * @param clientId
     * @return
     */
    DepositDetailsApproved findDepositDetailsApproveds(@Param("did") String did,
                                                      @Param("wOrderId") String wOrderId,
                                                      @Param("clientId") String clientId);

    /**
     *  查询接货完成的工单详情
     * @param did
     * @param wOrderId
     * @param clientId
     * @return
     */
    DepositDetailsApproved findDepositDetailsStorage(@Param("did") String did,
                                                     @Param("wOrderId") String wOrderId,
                                                     @Param("clientId") String clientId);

    /**
     *  查询已入库的工单详情
     * @param did
     * @param wOrderId
     * @param clientId
     * @return
     */
    DepositDetailsApproved findDepositDetailsCarry(@Param("did") String did,
                                                   @Param("wOrderId") String wOrderId,
                                                   @Param("clientId") String clientId);

    /**
     * 查询客户信息
     * @param clientId
     * @return
     */
    ClientNamePhone findClientNamePhone(@Param("clientId") String clientId);

    /**
     * 查询商品
     * @param did
     * @param clientId
     * @return
     */
    List<DepositProductDetails> findDepositProductDetails(String did,String clientId);

    List<DepositProductDetails> findDepositProductDetailsByHt(String did);

    /**
     * 查询当前客户对应的所有经销商列表
     * @param userId
     * @return
     */
    List<DealerList> findDealerList(@Param("userId") String userId);

    /**
     * 删除退押金工单
     * @param returnDepositEditDto
     * @return
     */
    int delReturnDeposit(@Param("did") String did,@Param("returnDepositEditDto") ReturnDepositEditDto returnDepositEditDto);
}
